<%@ page language="java"  pageEncoding="utf-8"%>
<%@page import="java.nio.charset.Charset"%>
<%@page import="com.ejoysoft.wlanyz.business.ThreeNet"%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%@ page import=" java.util.Vector,com.ejoysoft.wlanyz.business.WarnAppear,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("10035"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
%>
<%
    //初始化
    ThreeNet  warn=null;
    ThreeNet obj=new ThreeNet(globa);
    //查询条件
    String exportFlag = ParamUtil.getString(request,"exportFlag","");
	String strNeiCommunityId = ParamUtil.getString(request,"strNeiCommunityId","");
	//strNeiCommunityId = strNeiCommunityId.replace("a",",");
	String exportContent = ParamUtil.getString(request,"exportContent","");

	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","15");
	Vector<ThreeNet> vctObj=obj.list2(strNeiCommunityId);
	System.out.println("///////////"+strNeiCommunityId);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
    
	if(exportFlag.equals("exportResult"))
	{
   	   	StringBuffer sb = new StringBuffer("<html><body><table border='1'>");
   	    sb.append("<tr><td>地市</td><td>区县</td><td>小区名称</td><td>网络类型</td><td>LAC</td><td>CI</td><td>测试时间</td></tr>");
	    if (vctObj.size() != 0)
	    {  
	        for (int i = 0; i < vctObj.size(); i++)
		    {
		    System.out.println(vctObj.get(i).getStrCity()+vctObj.get(i).getStrTown());
		       sb.append("<tr><td> ");
		       sb.append((vctObj.get(i).getStrCity()==null?"":vctObj.get(i).getStrCity()));
		       sb.append("</td><td> ");
		         sb.append((vctObj.get(i).getStrTown()==null?"":vctObj.get(i).getStrTown()));
		          sb.append("</td><td> ");
		          sb.append((vctObj.get(i).getStrSiteName()==null?"":vctObj.get(i).getStrSiteName()));
		          sb.append("</td><td> ");
		         sb.append((vctObj.get(i).getStrSiteType()==null?"":vctObj.get(i).getStrSiteType()));
		          sb.append("</td><td> ");
		         sb.append((vctObj.get(i).getStrLac()==null?"":vctObj.get(i).getStrLac()));
		          sb.append("</td><td> ");
		        sb.append((vctObj.get(i).getStrCommunityId()==null?"":vctObj.get(i).getStrCommunityId()));
		         sb.append("</td><td> ");
		         sb.append((vctObj.get(i).getDtCreateDate()==null?"":vctObj.get(i).getDtCreateDate()) );
		          sb.append("</td></tr>"); 
		    }
	    }
   	   	sb.append("</table></body></html>");
   	   	System.out.println(sb);
	    String strFileName = "相邻小区信息表.xls";//自定义xls文件的文件名
	    response.setCharacterEncoding("utf-8");
	    response.setContentType("APPLICATION/*;charset=utf-8");
	    response.setHeader( "Content-Disposition", "attachment;filename="  + new String( strFileName.getBytes("gbk"), "ISO8859-1"));
	    out.clearBuffer(); 
	    out = pageContext.pushBody();
	    ServletOutputStream output = response.getOutputStream();
	    System.out.println(sb.toString().getBytes("utf-8"));
	    output.write(sb.toString().getBytes("utf-8"));
	  //out.clearBuffer(); 
	//  WarnAppear.shareMethodForExport(sb,strFileName,response,out,pageContext);
 
	} 
%>
<%@ include file="../include/jsp/footer.jsp"%>
